<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h2>ES6的class继承前戏</h2>
</body>
<script>
    //ES6如何创建一个类
    class A {
        //构造器
        constructor(name,age) {
        this.name=name;
        this.age=age
        }

        go() {
            console.log('gogogogo')
        }
        play() {}
        ko() {}
    }

    //ES6如何继承一个类
    class B extends A {
        constructor() {
            super()
        }
    }

    const b1=new B();
    b1.go()
</script>
</html>